import React, { Component } from 'react'
import { Children } from 'react'
export default class CreateRef extends Component {
    input = React.createRef()
    result = React.createRef()
  render() {
    return (
      <div>
        <input type="text" ref={this.input}/>
        <button onClick={this.show}></button>
        <div ref={this.result} style={{width: 400, height: 300, border:'solid 1px #666'}}></div>
      </div>
    )
  }
  show = ()=>{
    let v = this.input.current.value
    this.result.current.innerHTML = v
  }
}
